<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="ccc">
        <p>
            姓名:
        </p>
        <p>
            年龄：
        </p>
    </div>
    <script src="./js/template.js"></script>
    <script type="text/html" id="aaa">
        <p>
            姓名:{{name}}
        </p>
        <p>
            年龄：{{age}}
        </p>
    </script>
    <script>
        var date = {
            name: 'ls',
            age: 90
        }
        let str = template('aaa', date)
        document.querySelector('#ccc').innerHTML = str
        $('#ccc').html(str)
    </script>
</body>

</html>